package redis;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.Dao.User;
import redis.Dao.UserDao;

/**
 * Created by admin on 2016-11-14.
 */
public class App
{
    @SuppressWarnings("resource")
    public static void main( String[] args )
    {
        ApplicationContext ac =  new ClassPathXmlApplicationContext("classpath:/springContext.xml");
        UserDao userDAO = (UserDao)ac.getBean("userDao");
        User user = new User();
        user.setId(1);
        user.setName("liuxg");
        userDAO.saveUser(user);

        User liuxg = userDAO.getUser(1);
        System.out.println(liuxg.getName());
    }
}